package com.luych.toolbox.common.feign.view.automation.service;

import com.luych.toolbox.common.enums.AutoTaskHistoryStatus;
import com.luych.toolbox.common.feign.FeignView;
import com.luych.toolbox.common.feign.view.base.service.UserView;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.List;

@ApiModel("任务执行数据返回")
public class AutoTaskHistoryView extends FeignView {

    @ApiModelProperty("名称")
    private String name;
    @ApiModelProperty("任务模板")
    private AutoTaskTemplateView template;
    @ApiModelProperty("状态")
    private AutoTaskHistoryStatus status;
    @ApiModelProperty("异常信息")
    private String errorMessage;
    @ApiModelProperty("异常堆栈")
    private String errorTrace;
    @ApiModelProperty("责任人")
    private UserView owner;
    @ApiModelProperty("开始时间")
    private Date startDate;
    @ApiModelProperty("结束时间")
    private Date completeDate;
    @ApiModelProperty("目标服务器")
    private List<AutoSshServerView> servers;
    @ApiModelProperty("执行参数")
    private List<AutoTaskHistoryArgView> args;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public AutoTaskTemplateView getTemplate() {
        return template;
    }

    public void setTemplate(AutoTaskTemplateView template) {
        this.template = template;
    }

    public AutoTaskHistoryStatus getStatus() {
        return status;
    }

    public String getStatusValue() {
        return status == null ? null : status.getValue();
    }

    public void setStatus(AutoTaskHistoryStatus status) {
        this.status = status;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public String getErrorTrace() {
        return errorTrace;
    }

    public void setErrorTrace(String errorTrace) {
        this.errorTrace = errorTrace;
    }

    public UserView getOwner() {
        return owner;
    }

    public void setOwner(UserView owner) {
        this.owner = owner;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getCompleteDate() {
        return completeDate;
    }

    public void setCompleteDate(Date completeDate) {
        this.completeDate = completeDate;
    }

    public List<AutoSshServerView> getServers() {
        return servers;
    }

    public void setServers(List<AutoSshServerView> servers) {
        this.servers = servers;
    }

    public List<AutoTaskHistoryArgView> getArgs() {
        return args;
    }

    public void setArgs(List<AutoTaskHistoryArgView> args) {
        this.args = args;
    }
}